package com.luojing.innerclass.controllerframework;

/**
 * @author luojing
 * @create 2018/09/08 上午11:34
 **/
public abstract class Event {

  private long eventTime;

  protected final long dalayTime;

  public Event(long dalayTime){
    this.dalayTime = dalayTime;
    start();
  }

  public void start(){
    eventTime = System.nanoTime() + dalayTime;
  }

  public boolean ready(){
    return System.nanoTime() >= eventTime;
  }

  public abstract void action();

}
